import request from "@/utils/request";

// 查询消耗品列表
export function listConsumables(query) {
  return request({
    url: "/admin/assets/consumables/",
    method: "get",
    params: query
  });
}

// 查询消耗品详细
export function getConsumables(id) {
  return request({
    url: "/admin/assets/consumables/" + id + "/",
    method: "get"
  });
}

// 新增消耗品
export function addConsumables(data) {
  return request({
    url: "/admin/assets/consumables/",
    method: "post",
    data: data
  });
}

// 修改消耗品
export function updateConsumables(data) {
  return request({
    url: "/admin/assets/consumables/" + data.id + "/",
    method: "put",
    data: data
  });
}

// 删除消耗品
export function delConsumables(id) {
  return request({
    url: "/admin/assets/consumables/" + id + "/",
    method: "delete"
  });
}

// 导出消耗品
export function exportConsumables(query) {
  return request({
    url: "/admin/assets/consumables/export/",
    method: "get",
    params: query
  });
}

// 借出
export function consumableCheckout(data) {
  return request({
    url: "/admin/assets/consumablecheckout/",
    method: "post",
    data: data
  });
}

// 借出记录
export function consumableRecords(query) {
  return request({
    url: "/admin/assets/consumablerecords/",
    method: "get",
    params: query
  });
}

export function importsConsumables(data) {
  return request({
    url: "/admin/assets/consumables/import/",
    method: "post",
    data: data
  });
}
